package com.ludomancy.spaceopera;


import java.awt.Point;

import com.ludomancy.gamelib.MathHelper;
import com.ludomancy.gamelib.WorldScreenProjection;
import com.ludomancy.gamelib.entity.Entity;

public class BasicEntity extends Entity
{
	protected WorldScreenProjection proj;
	
	protected static final int ZBACK = 0;
	protected static final int ZMIDDLE = 1;
	protected static final int ZFRONT = 2;
	protected static final int ZTOP = 3;
	
	public BasicEntity(Point pos)
	{
		super(pos);
		proj = Game.game.defaultProjector;
	}
		
	public boolean isInteractable()
	{
		return false;
	}
	
	public String getInteractionVerb()
	{
		return "None";
	}
	
	public Point getNextPos(Point to, int speed)
	{
		float dirX = to.x - pos.x;
		float dirY = to.y - pos.y;
		if(MathHelper.dist(0, 0, dirX, dirY) < speed)
		{
			return new Point(to.x, to.y);
		}
		else
		{
			float[] norm = MathHelper.normalize(dirX, dirY, new float[2]);
			dirX = norm[0];
			dirY = norm[1];
			dirX *= speed;
			dirY *= speed;
			return new Point(pos.x + (int)dirX, pos.y + (int)dirY);
		}
	}
	
	public void onPlayerHit(Player player)
	{
	}

	public void onPlayerInteraction(Player player)
	{
	}	
}
